home *** CD-ROM | disk | FTP | other *** search
- /* \better-c\window.d
-
- Version: 0.00
- Author: kat
- Create: 11/10/89
- Update: 11/10/89
-
-
- Window management OOP style
-
- */
-
-
- /* Defines and enums */
-
- #define Object_max 20
- #define Factor 2 /* 1 for text, 1 for attrib */
-
- #define Window wdw->p[handle]->
-
- #define Direct_video_default true /* true: direct memory mapping; false: bios */
-
- /* Bios: interrupts and defines */
-
- #define Bios_video 0x10
- #define Bios_keyboard 0x16
- #define Bios_multipurpose 0x21
- #define Bios_char_write 0x09
- #define Bios_char_read 0x08
- #define Bios_cursor_position 0x02
- #define Bios_cursor_size 0x01
- #define Bios_scroll_window_up 0x06
- #define Bios_mono_address 0xB000
- #define Bios_color_address 0xB800
- #define Bios_video_mono_test (*(char far *) 0x00400049L == 7)
- #define Bios_read_keyboard_char 0x07
- #define Bios_test_keyboard_status 0x01
- #define Bios_cursor_off 0x20
- #define Bios_cursor_top_color 6
- #define Bios_cursor_bottom_color 7
-
- #define Bios_cursor_top_mono 0x0B
- #define Bios_cursor_bottom_mono 0x0C
-
- #define Screen_width 79 /* 0 - 79 */
- #define Screen_height 24 /* 0 - 24 */
- #define Default_attribute 7
-
- #define Zero_flag 0x40
-
- #define Extended_base 128 /* used for mapping above the ASCII set */
-
-
- #define S_vert_line 179 /* single line */
- #define S_hor_line 196
- #define S_ur 191 /* upper right corner */
- #define S_lr 217 /* lower right */
- #define S_ll 192 /* lower left */
- #define S_ul 218 /* upper left */
-
- #define D_vert_line 186 /* double line */
- #define D_hor_line 205
- #define D_ur 187
- #define D_lr 188
- #define D_ll 200
- #define D_ul 201
-
- #define Input_no_echo -2
- #define Input_echo -1
-
- /* row/col coordinate map macro into memory area for text and attibute */
- #define Offset ( Factor * (row * (Window cols) + col))
- #define Line_size ( Factor * (Window cols))
- #define Scroll_adjust 2
-
- /* coordinate map macro into video memory area for text and attibute */
- #define Video_offset ( Factor * ((row + Window disp_row) * 80 + Window disp_col))
- #define Cursor_offset ( Factor * (row * 80 + col))
-
- /* make far pointer: used for direct video mapping */
-
- #define Make_far_pointer(seg, ofs) ((void far *) \
- ((( unsigned long )(seg) << 16) | (unsigned)( ofs )))
- #define Far_offset(fp) ((unsigned)(fp))
- #define Far_segment(fp) ((unsigned)((unsigned long)(fp) >> 16))
-
- #define Printable(c) ((c) >= 0x20 && (c) <= 0x7e)
-
-
- enum border_style_ {
- No_border,
- Solid_border,
- Single_border,
- Double_border
- };
-
- enum color_attribute_ {
- Black,
- Blue,
- Green,
- Cyan,
- Red,
- Magenta,
- Brown,
- White,
- Gray, /* high intensity */
- Hi_blue,
- Hi_green,
- Hi_cyan,
- Hi_red,
- Hi_magenta,
- Yellow,
- Hi_white
- };
-
- enum read_write_option_ {
- Display_window,
- Save_window_area,
- Restore_window_area
- };
-
-
-
- /* bios attribute macro in NL */
- #define On + 16 * /* Usage example: Blue On Red */
-
- /* Pop-up prompt and menu defines */
-
- #define Pop_up_prompt_vertical_size 3
- #define Pop_up_prompt_hor_adjust 3
- #define Pop_up_prompt_input_adjust 2
- #define List_separator '|'
- #define List_delimiter (char *) "|"
- #define Pop_up_menu_ver_extra 4
- #define Pop_up_menu_hor_extra 5
- #define Pop_up_menu_top 2
- #define Pop_up_menu_title_line 2